package spi;

import java.util.Arrays;
import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @author MaoLin Wang
 * @date 2020/10/16 9:07 上午
 */
public class Main {
    public static void main(String[] args) {
        ServiceLoader<LoadBalance>serviceLoader=ServiceLoader.load(LoadBalance.class);
        Iterator<LoadBalance> iterator = serviceLoader.iterator();
        while (iterator.hasNext()) {
            String s = iterator.next().selectOne(Arrays.asList("1", "2"));
            System.out.println(s);
        }
    }
}
